package com.zwps.biz;

import com.zwps.starter.ApplicationBoot;
import org.junit.jupiter.api.Test;
import org.springframework.boot.test.context.SpringBootTest;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.Statement;
import java.util.ArrayList;

@SpringBootTest(classes = ApplicationBoot.class)
public class test {

    @Test
    public void test(){

        String dbPath = "jdbc:ucanaccess://\\\\192.168.1.8\\DDrive\\阀门数据(1).accdb";

        try (Connection connection = DriverManager.getConnection(dbPath);
             Statement stmt = connection.createStatement()) {

            String query = "SELECT 日期, 时间 FROM 闸门数据";
            ResultSet rs = stmt.executeQuery(query);
            while (rs.next()) {
                System.out.println("日期："+rs.getString("日期"));
                System.out.println("时间："+rs.getString("时间"));

            }

        } catch (Exception e) {
            e.printStackTrace();
        }


    }
}
